/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GeneralTesting;

import java.util.Random;
import java.util.Vector;

/**
 *
 * @author Heather
 */
public class Cat
{

  public String name = "cat";
  public int age = 0;
  public Vector<String> favoriteFood = new Vector<String>();
  private Random randGen = new Random();
  public HairBall catBall;

  public Cat()
  {
    favoriteFood.add("fish");
    favoriteFood.add("milk");
    catBall = new HairBall();
  }

  public Cat(String name)
  {
    favoriteFood.add("fish");
    favoriteFood.add("milk");
    catBall = new HairBall();
    this.name = name;
  }

  public void hack()
  {
    catBall.hack();
  }

  public Cat clone()
  {
    //return (Cat)super.clone();
    return this;
  }

  public double getRandom()
  {
    return randGen.nextDouble();
  }

  private class HairBall
  {

    private HairBall()
    {
      //System.out.println("hair ball!");
    }

    private void hack()
    {
      if (age > 1)
      {
        System.out.println("hair ball!!!!!!");
      }
      else
      {
        System.out.println("too young for hair balls");
      }
    }
  }
}
